package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.HyRecordBean;
import com.mz.ozy.mvp.model.HyRecordModel;
import com.mz.ozy.mvp.view.HyRecordContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class HyRecordPresenter extends BasePresenterImpl<HyRecordContract.View> implements HyRecordContract.Presenter {

    private HyRecordModel mModel;

    public HyRecordPresenter() {
        mModel = new HyRecordModel();
    }


    @Override
    public void getHyRecord(Activity activity, String pageNo) {
        mModel.getHyRecord(activity, pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<HyRecordBean>(mView, false) {
                    @Override
                    public void onSuccesss(HyRecordBean bean) {
                        mView.getHyRecordSuccess(bean);
                    }
                });
    }
}
